<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"  
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html" 
      xmlns:rich="http://richfaces.org/rich" 
      xmlns:a4j="http://richfaces.org/a4j" 
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:c="http://java.sun.com/jsp/jstl/core"
      xmlns:p="http://xmlns.jcp.org/jsf/passthrough">
    <h:head>
        <title>Listado Socios</title>

    </h:head>
    <h:body>

        <ui:composition template="/prot/principal.xhtml">
            <ui:define name="content">  

                <!-- Main bar -->
                <div class="mainbar">

                    <!-- Page heading -->
                    <div class="page-head">
                        <!-- Page heading -->
                        <h2 class="pull-left">Lista de Socios
                            <!-- page meta -->
                            <span class="page-meta">Socios del VideoClub</span>
                        </h2>


                        <!-- Breadcrumb -->
                        <div class="bread-crumb pull-right">
                            <a href="../prot/entrada.xhtml"><i class="icon-home"></i> Home</a> 
                            <!-- Divider -->
                            <span class="divider">/</span> 
                            <a href="listSocios.xhtml" class="bread-current">Socios</a>
                        </div>

                        <div class="clearfix"></div>

                    </div>
                    <!-- Page heading ends -->








                        <div class="matter">
                            <div class="container">

                                <div class="row">

                                    <div class="col-md-12">

                                        <div class="widget wblue">

                                            <rich:messages/>

                                            <div class="widget-head">
                                                <div class="pull-left">

                                                    <h:commandLink styleClass="btn btn-primary" style="text-decoration: none;color: white;" actionListener="#{ctrSocio.seleccionaOpcion('N')}" value="#{msg.nuevo}" />
                                                    <h:commandLink styleClass="btn btn-primary" style="text-decoration: none;color: white;" actionListener="#{ctrSocio.seleccionaOpcion('E')}" value="#{msg.editar}" />
                                                    
                                                    <!--h:commandLink styleClass="btn btn-primary" style="text-decoration: none;color: white;padding-left: 10px;" actionListener="#{ctrProyecto.imprimir}" value="#{msg.imprimir}" /-->





                                                </div>
                                                <div class="widget-icons pull-right">
                                                    <div class="sidebar-widget">
                                                        <h:panelGrid columns="2" rendered="false" >
                                                            <h:inputText p:type="text" class="form-control" p:placeholder="Search" value="#{ctrSocio.txtBuscar}"  style="width: 190px" />
                                                            <h:commandButton styleClass="btn btn-primary" style="text-decoration: none;color: white;" action="#{ctrSocio.refrescar}" value="#{msg.buscar}" />
                                                        </h:panelGrid>
                                                    </div>

                                                </div>
                                                <div class="clearfix"></div>
                                            </div>    

                                            <div class="widget-content">
                                                <rich:dataTable value="#{ctrSocio.lstSocios}" var="socio" iterationStatusVar="it" id="tbSocios" rows="15"
                                                                rowClasses="odd-row, even-row"  styleClass="table  table-bordered " style="width: 100%;" >

                                                    <rich:column style="width: 20px">
                                                        <f:facet name="header">
                                                            
                                                        </f:facet>
                                                        <h:selectBooleanCheckbox value="#{socio.seleccionado}" />
                                                    </rich:column>



                                                    <rich:column>
                                                        <f:facet name="header">Codigo</f:facet>
                                                        <h:outputText value="#{socio.codigo}" />
                                                    </rich:column>

                                                    <rich:column>
                                                        <f:facet name="header">#{msg.nombre}</f:facet>
                                                        <h:outputText value="#{socio.nombre}" />
                                                    </rich:column>

                                                    <rich:column>
                                                        <f:facet name="header">Edad</f:facet>
                                                        <h:outputText value="#{socio.edad}" />
                                                    </rich:column>
                                                    
                                                    <rich:column>
                                                        <f:facet name="header">VideoClub</f:facet>
                                                        <h:outputText value="#{socio.videoclub.ciudad}_#{socio.videoclub.calle}" />
                                                    </rich:column>

                                                                                                       


                                                    <f:facet name="footer">
                                                        <rich:dataScroller page="1" />
                                                    </f:facet>
                                                </rich:dataTable>



                                            </div>



                                        </div>

                                    </div>

                                </div>

                            </div>

                        </div>









                        <f:event type="preRenderView" listener="#{ctrSocio.buscar}"/>


    
                </div>





                <!-- Mainbar ends -->

                <rich:jQuery selector=".stable tr:odd" query="addClass('odd-row')" />
                <rich:jQuery selector=".stable tr:even" query="addClass('even-row')" />
                <rich:jQuery selector=".stable tr" event="mouseover" query="jQuery(this).addClass('active-row')" />
                <rich:jQuery selector=".stable tr" event="mouseout" query="jQuery(this).removeClass('active-row')" />


            </ui:define>
        </ui:composition>

    </h:body>
</html>